(line-move-partial): Optimize. Try window-line-height
authorKim F. Storm <storm@cua.dk>
Tue, 19 Sep 2006 13:12:50 +0000 (13:12 +0000)
committerKim F. Storm <storm@cua.dk>
Tue, 19 Sep 2006 13:12:50 +0000 (13:12 +0000)
before posn-at-point to get vpos of current line.

lisp/simple.el

index 0a257863a7620638f05381666b92cfb575662741..5a30471ca49f78d3df924576b445e06af477c250 100644 (file)
@@ -3507,9 +3507,11 @@ Outline mode sets this."
          nil)
         ;; If cursor is not in the bottom scroll margin, move forward.
         ((and (> vpos 0)
-              (< (setq ppos (posn-at-point)
-                       py (cdr (or (posn-actual-col-row ppos)
-                                   (posn-col-row ppos))))
+              (< (setq py
+                       (or (nth 1 (window-line-height))
+                           (let ((ppos (posn-at-point)))
+                             (cdr (or (posn-actual-col-row ppos)
+                                      (posn-col-row ppos))))))
                  (min (- (window-text-height) scroll-margin 1) (1- vpos))))
          nil)
         ;; When already vscrolled, we vscroll some more if we can,